<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Schools Management System</title>
<meta http-equiv="Content-Language" content="English" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="../style.css" media="screen" />
<script>
function del_confirm()
{
	  $butt="";
	  if($T_NIC_Number!="")
	  {
var r=confirm("Are you sure to delete this?");
if (r==true)
  {
    $butt="Yes";
	<?php
include_once '../Login/databaseconnection.php';

if(!loggedin())
{
	require_once '../index.php';
}
   
   else
   {

	 $T_NIC_Number=$_POST['T_NIC_Number'];
	 if($Census_Number!="")
	   {
	   
	 if($butt="Yes")
	   {
	   $result=mysql_query("SELECT * FROM teacher WHERE T_NIC_Number='$T_NIC_Number'");
 mysql_query("DELETE FROM teacher WHERE T_NIC_Number='$T_NIC_Number'");
	if($del)
  {
$_SESSION['error']="Your record is successfully deleted!";
 
  }

  if(!$del)
  {
 $_SESSION['error']="Sorry unable to delete your record!";
  

  } 
   }
   }
    
 if($T_NIC_Number=="")
	   {
		   $_SESSION['errorin']="Please select the censusnumber to delete!";
   
	   }  
   }
  ?>
	
	}
	}
if(r==false)
  {
    $butt="No";
  }
}
</script>

</head>
<body>
 <?php
require_once '../Login/databaseconnection.php';
if(!loggedin())
{
require_once '../index.php';

}
   
   else
   {
   if(isset($_POST['Delete']))
{

	   if( $T_NIC_Number==" ")
	   {
		   $_SESSION['errorin']="Not enough inputs!";
   }
}
  ?>
<div id="wrap">

<div id="header">
<table width="1188" border="0">
  <tr>
    <td width="706" height="119"><h1 class="heaaderte"><font color="#996699" style="text-shadow:#969" size="+6">Schools Management System</font></h1></td>
    <td width="472">&nbsp;</td>
  </tr>
</table>

</div>

<div id="menu1_bg">
		<div id="menu1">
			
	
	
				<ul>
				<li><a href="../index.php"><font color="#CCCC66" style="text-shadow:#969" size="+1">Home</font></a></li>
				<li><a href="../Schools/Schools.php"><font color="#CCCC66" style="text-shadow:#969" size="+1">Schools</font></a></li>
				<li><a href="teachers.php"><font color="#CCCC66" style="text-shadow:#969" size="+1">Teachers</font></a></li>
				<li><a href="../Lab/Labs.php"><font color="#CCCC66" style="text-shadow:#969" size="+1">Labs</font></a></li>
				<li><a href="../Resources/Resources.php"><font color="#CCCC66" style="text-shadow:#969" size="+1">Resources</font></a></li>
                <li><a href="#"><font color="#CCCC66" style="text-shadow:#969" size="+1">Resource Team</font></a></li>
                         <li><a href="../Programmes/Programmes.php" class="active"><font color="#CCCC66" style="text-shadow:#969" size="+1">Programmes</font></a></li>
                                  <li><a href="../Competition/Competition.php"><font color="#CCCC66" style="text-shadow:#969" size="+1">Competitions</font></a></li>
                 <li></li>
			</ul>
	</div>
  </div>
<div class="left">
  
<div class="articles">
<form onsubmit="delete()" action="#" method="POST">
  <table width="354" border="0">
    <tr>
      <th height="29" colspan="2"  scope="row">
      <?php
      if(isset($_POST['Delete']))
{
	if($_SESSION['errorin']!=" ")
	{
		echo($_SESSION['errorin']);
		$_SESSION['errorin']=" ";
	}
}   
?>
</th>
      </tr>
    <tr>
      <th width="200" height="29"  scope="row">Teachers NIC Number:</th>
      <td width="144"><select name="T_NIC_Number">
      </select></td>
    </tr>
    <tr>
    </tr>
  </table>

  <br/>
      <a href="deltea.php">Reset</a>|
    <input name="Delete" align="middle" type="submit" value="Delete" onclick="del_confirm()" />
 <br/>
   </form>
  <?php
   	   if(isset($_POST['Delete']))
{
	  if($butt=="Yes")
	  {
	   $T_NIC_Number=$_POST['T_NIC_Number'];
	   
	  if($T_NIC_Number!=" ")
	   {
   
	   
    echo '<table width="458" border="0">';
	while($row=mysql_fetch_array($result))
  { 
  $T_NIC_Number=$row['T_NIC_Number'];
  $School_Id=$row['School_Id'];
  $First_Name=$row['First_Name'];
  $Last_Name=$row['Last_Name'];
  $Date_Of_Birth=$row['Date_Of_Birth'];
  $Gender=$row['Gender'];
  $Nature_Of_Appointment=$row['Nature_Of_Appointment'];
  $Service=$row['Service'];
  $Acadamic_Qualifications=$row['Acadamic_Qualifications'];
  $Professional_Qualifications=$row['Professional_Qualifications'];
  $Achievements=$row['Achievements&Awards'];
  $Address=$row['Address'];
  $Mobile_Tp_Number=$row['Mobile_Tp_Number'];
  $Home_Tp_Number=$row['Home_Tp_Number'];
  $Office_Tp_Number=$row['Office_Tp_Number'];
  $Appointment_Date=$row['Appointment_Date'];
  $Appointed_Subject=$row['Appointed_Subject']; 
    ?>
    <?php
       echo '<tr>';
        echo '<th width="200" height="44" scope="row">';
		echo "Teachers NIC Number:";
		echo '</th>';
        echo '<td width="144">';
		echo '<input type="text" name="textfield22" value="$p_name" />';
		echo '</td>';
      echo '</tr>';
      echo '<tr>';
        echo '<th height="44" scope="row">';
		echo "School Id:";
		echo '</th>';
        echo '<td>';
		echo '<input type="text" name="textfield5" value="$no_stu" />';
		echo '</td>';
      echo '</tr>';
      echo '<tr>';
        echo '<th height="44" scope="row">';
		echo "First Name:";
		echo '</th>';
        echo '<td>';
		echo '<input type="text" name="textfield6" value="$te_in_trai" />';
		echo '</td>';
      echo '</tr>';
      echo '<tr>';
        echo '<th height="44" scope="row">';
		echo "Last_Name :";
		echo "</th>";
       echo '<td>';
	   echo '<input type="text" name="textfield7" value="$tra_tea" />';
	   echo '</td>';
      echo '</tr>';
      echo '<tr>';
        echo '<th height="44" scope="row">';
		echo "Date of Birth:"; 
		echo '</th>';
        echo '<td>';
		echo '<input type="text" name="textfield" value="$Ava_books" />';
            
        echo '</td>';
      echo '</tr>';
      echo '<tr>';
        echo '<th height="44" scope="row">';
		echo "Gender:"; 
		echo '</th>';
        echo '<td>';
		echo '<input type="text" name="textfield8" value="$Ava_T_Gui" />';
		
		echo '</td>';
      echo '</tr>';
      echo '<tr>';
        echo '<th height="44" scope="row">';
		echo "Nature Of Appointment:"; 
		echo '</th>';
        echo '<td>';
		echo '<input type="text" name="textfield8" value="$Ava_T_Gui" />';
		
		echo '</td>';
      echo '</tr>';
      echo '<tr>';
        echo '<th height="44" scope="row">';
		echo "Service:"; 
		echo '</th>';
        echo '<td>';
		echo '<input type="text" name="textfield8" value="$Ava_T_Gui" />';
		
		echo '</td>';
      echo '</tr>';
      echo '<tr>';
        echo '<th height="44" scope="row">';
		echo "Acadamic Qualifications:"; 
		echo '</th>';
        echo '<td>';
		echo '<input type="text" name="textfield8" value="$Ava_T_Gui" />';
		
		echo '</td>';
      echo '</tr>';
      echo '<tr>';
        echo '<th height="44" scope="row">';
		echo "Professional Qualifications:"; 
		echo '</th>';
        echo '<td>';
		echo '<input type="text" name="textfield8" value="$Ava_T_Gui" />';
		
		echo '</td>';
      echo '</tr>';
      echo '<tr>';
        echo '<th height="44" scope="row">';
		echo "Achievements:"; 
		echo '</th>';
        echo '<td>';
		echo '<input type="text" name="textfield8" value="$Ava_T_Gui" />';
		
		echo '</td>';
      echo '</tr>';
      echo '<tr>';
        echo '<th height="44" scope="row">';
		echo "Address:"; 
		echo '</th>';
        echo '<td>';
		echo '<input type="text" name="textfield8" value="$Ava_T_Gui" />';
		
		echo '</td>';
      echo '</tr>';
      echo '<tr>';
        echo '<th height="44" scope="row">';
		echo "Mobile Telephone Number:"; 
		echo '</th>';
        echo '<td>';
		echo '<input type="text" name="textfield8" value="$Ava_T_Gui" />';
		
		echo '</td>';
      echo '</tr>';
      echo '<tr>';
        echo '<th height="44" scope="row">';
		echo "Home Telephone Number:"; 
		echo '</th>';
        echo '<td>';
		echo '<input type="text" name="textfield8" value="$Ava_T_Gui" />';
		
		echo '</td>';
      echo '</tr>';
      echo '<tr>';
        echo '<th height="44" scope="row">';
		echo "Office Telephone Number:"; 
		echo '</th>';
        echo '<td>';
		echo '<input type="text" name="textfield8" value="$Ava_T_Gui" />';
		
		echo '</td>';
      echo '</tr>';
      echo '<tr>';
        echo '<th height="44" scope="row">';
		echo "Appointment Date:"; 
		echo '</th>';
        echo '<td>';
		echo '<input type="text" name="textfield8" value="$Ava_T_Gui" />';
		
		echo '</td>';
      echo '</tr>';
      echo '<tr>';
        echo '<th height="44" scope="row">';
		echo "Appointed Subject:"; 
		echo '</th>';
        echo '<td>';
		echo '<input type="text" name="textfield8" value="$Ava_T_Gui" />';
		
		echo '</td>';
      echo '</tr>';
		
   }
    echo '</table>';
	
	}
	}mysql_free_result($result);	
	}
    ?>
</div>
</div>

<div class="rightmenu"> 
<h1>TEACHERS</h1><br />
<table width="220" border="0">
  <tr>
    <td width="210" height="41"><a href="regtea.php">Add New Teaher Details</a></td>
   

  </tr>
 
  <tr>
    <td height="41"><a href="searchtea.php">Search Teachers Details</a></td>

    
  </tr>
  <tr>
    <td height="41"><a href="updatetea.php">Update a Teachers Details</a></td>
 
    
  </tr>
  <tr>
    <td height="41"><a href="deltea.php">Delete Teachers Details</a></td>
    
    
  </tr>
  <tr>
    <td height="41"><a href="viewalltea.php">View All</a></td>
   

  </tr>
</table>
</div>
 
 <div style="clear: both;"> </div>


<div id="footer"><table width="1236" height="38" border="0">
    <tr>
      <td width="904" height="34">Schools Managemrnt System &copy; 2012 </td>
      <td width="50"><strong><a href="#" class="active">Home</a><a href="#"></a></strong>|</td>
      <td width="80"><strong><a href="#">Contact us</a></strong>|</td>
      <td width="40"><a href="http//www.facebook.com"><img src="../images/facebook1.png" width="38" height="38"/></a></td>
      <td width="38"><a href="http//twitter.com"><img src="../Images/twitter.png" width="38" height="38"/></a></td>
      <td width="36"><a href="http//www.google.lk"><img src="../Images/google.png" width="38" height="38"/></a><a href=""http="http"//www.yahoo.com""></a></td>
      <td width="58"><a href=""http="http"//www.yahoo.com""><img src="../Images/yahoo.png" alt="" width="38" height="38"/></a></td>
    </tr>
  </table>
 
</div>
</div>
<?php
	   if(isset($_POST['Delete']))
{
if( $P_Id!=" "&&$S_Id!=" "&&$year!=" ")
{

//message alert to delete

   }
   }
   }
?>
</body>
</html>